package com.xinzhi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xinzhi.domain.Cart;
import com.xinzhi.domain.Product;
import com.xinzhi.domain.vo.CartProductVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {



    Integer checkCartNumByUserId(Integer userId);

    Cart queryProductNum(@Param("userId") Integer userId,@Param("productId") Integer productId);

    Integer addProduct(Cart cart);

    Integer plusProductNum(@Param("userId") Integer userId,@Param("productId") Integer productId);

    Integer subtractProductNum(@Param("userId") Integer userId,@Param("productId") Integer productId);

    Integer delProduct(@Param("userId") Integer userId,@Param("productId") Integer productId);

    Integer changeSelected(Integer userId, Integer productId,Integer selected);

    Integer changeAllSelected(@Param("userId") Integer userId,@Param("selected") Integer selected);

    List<Cart> queryAllCart(Integer userid);

    List<CartProductVo> queryCartDetail(Integer userid);

}
